/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.cn.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.cn.entity.AttendanceCn;
import com.thinkgem.jeesite.modules.cn.dao.AttendanceCnDao;

/**
 * 中国考勤Service
 * @author hui.li
 * @version 2017-02-20
 */
@Service
@Transactional(readOnly = true)
public class AttendanceCnService extends CrudService<AttendanceCnDao, AttendanceCn> {
	@Autowired
	private  AttendanceCnDao dao;
	public AttendanceCn get(String id) {
		return super.get(id);
	}
	
	public List<AttendanceCn> findList(AttendanceCn attendanceCn) {
		return super.findList(attendanceCn);
	}
	
	public Page<AttendanceCn> findPage(Page<AttendanceCn> page, AttendanceCn attendanceCn) {
		return super.findPage(page, attendanceCn);
	}
	
	@Transactional(readOnly = false)
	public void save(AttendanceCn attendanceCn) {
		super.save(attendanceCn);
	}
	
	@Transactional(readOnly = false)
	public void updateStatus(AttendanceCn attendanceCn) {
		dao.updateStatus(attendanceCn);
	}
	
	@Transactional(readOnly = false)
	public void delete(AttendanceCn attendanceCn) {
		super.delete(attendanceCn);
	}
	/**
	 * 查询原始数据
	 * @return 
	 */
	@Transactional(readOnly = false)
	public List<AttendanceCn> queryAttendance() {
		return dao.queryAttendance();
	}
	
	/**
	 * 根据分组后查询
	 */
	@Transactional(readOnly = false)
	public List<AttendanceCn> syncAttendance() {
		return dao.syncAttendance();
	}
	
	/**
	 * 批量提交数据
	 * 
	 * @param list
	 */
	@Transactional(readOnly = false)
	public void batchupdate(List<AttendanceCn> list) {
		super.batchupdate(list);
	}
	
	//按天统计出勤
    public List<AttendanceCn> findListByDate(AttendanceCn condition) {       
        return dao.findListByDate(condition);
    }
}